import UIKit

var temp: Int = 999
// 格式1
var a = (12, "hello", true) //a.0
// 格式2 带元素类型
var b: (Int, String) = (32, "animal")
// 格式3 带元素名称
let (name, _, age) = ("Jack", "", 18)
print(name)
print(age)
// 格式4 带变量名称+元素名称+类型
let student: (name: String, grade: Double) = ("小明", 6)
student.name
student.grade

// 元组是值类型
let c = a

a.0 = 300
print(a) // (300, "hello", true)

// 修改a不影响c的值
print(c) // (12, "hello", true)

// 取值 1.索引2.通过变量
print(a.0)
print(a.1)
print(a.2)
